# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kpat
pkgver=22.04.3
pkgrel=0
pkgdesc="KPatience offers a selection of solitaire card games"
# armhf blocked by extra-cmake-modules
# s390x and riscv64 blocked by polkit -> kio
arch="all !armhf !s390x !riscv64"
url="https://kde.org/applications/games/kpat/"
license="GPL-2.0-or-later AND GFDL-1.2-only"
makedepends="
	black-hole-solver-dev
	extra-cmake-modules
	freecell-solver-dev
	kcompletion-dev
	kconfig-dev
	kconfigwidgets-dev
	kcoreaddons-dev
	kcrash-dev
	kdbusaddons-dev
	kdoctools-dev
	kguiaddons-dev
	ki18n-dev
	kio-dev
	knewstuff-dev
	kwidgetsaddons-dev
	kxmlgui-dev
	libkdegames-dev
	qt5-qtbase-dev
	qt5-qtsvg-dev
	samurai
	"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/release-service/$pkgver/src/kpat-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"
# Broken tests
options="!check"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
b14487ed075987fa5659da9ab7937853645bd25cd3f31bc7c465549683bb7efad5ec9347471c3a3b532528ed76a3133ef8eb5c5848939a987cbda5782eba7aa4  kpat-22.04.3.tar.xz
"
